import 'package:get/get.dart';
import 'package:honeypotflutter/public/public_alert.dart';
import 'package:honeypotflutter/public/public_get.dart';
import 'package:honeypotflutter/publicBussine/loginInfo/bussine_userInfo.dart';
import '../account_signed/view.dart';
import '../account_withdraw_amount/view.dart';

class AccountIncomeLogic extends GetxController {
  UserInfoLogic userInfoLogic = Get.find<UserInfoLogic>();

  /*
  * 去签约
  * */
  pushToSign() {
    if (userInfoLogic.userInfo.bankAccount != null) {
      HLAlert.showSureAlert(title: "您已签约", okLabel: "我知道了!");
      return;
    }
    HLGet.to(AccountSignedPage());
  }

  /*
  * 去提现
  * */
  pushToWithDrawAmount() {
    if (userInfoLogic.userInfo.bankAccount == null) {
      HLAlert.showSureCancelAlert(
          title: "未签约",
          message: "您还未签约,请先进行签约再提现",
          cancelLabel: "取消",
          okLabel: "去签约",
          sureAction: (bool isOk) {
            if (isOk) {
              HLGet.to(AccountSignedPage());
            }
          });
      return;
    }

    HLGet.to(AccountWithdrawAmountPage());
  }
}
